package home.my.base.sql;

import java.io.Serializable;


public class SingleOrNullCondition extends AbsCondition{
	
	public SingleOrNullCondition(String tableAlias,String column,String equalChar,Serializable value){
		this.setTableAlias(tableAlias);
		this.setColumn(column);
		this.setEqualChar(equalChar);
		this.setValue(value);
	}
	
	public SingleOrNullCondition(String column,String equalChar,Serializable value){
		this.setColumn(column);
		this.setEqualChar(equalChar);
		this.setValue(value);
	}
	
	public SingleOrNullCondition(String column,Serializable value){
		this.setColumn(column);
		this.setEqualChar("=");
		this.setValue(value);
	}

	@Override
	public String toSql() {
		return "(" + super.toSql() + " or " + getColumnWithTableName() + " is null )";
	}
	
}
